diff options
Diffstat (limited to 'www-2/src/pages/[...id].astro')
| -rw-r--r-- | www-2/src/pages/[...id].astro | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/www-2/src/pages/[...id].astro b/www-2/src/pages/[...id].astro new file mode 100644 index 0000000..b3c5b40 --- /dev/null +++ b/www-2/src/pages/[...id].astro @@ -0,0 +1,18 @@ +--- +import { getCollection, render } from "astro:content"; + +import ArticlePage from "../layouts/ArticlePage.astro"; + +export async function getStaticPaths() { + const posts = await getCollection("blogs"); + return posts.map((post) => ({ + params: { id: post.id }, + props: { post }, + })); +} + +const { post } = Astro.props; +const { Content } = await render(post); +--- + +<ArticlePage id={post.id} data={post.data}><Content /></ArticlePage> |
